package com.zc.angelica.controller;

import com.zc.angelica.entity.ResponseData;
import com.zc.angelica.entity.RoleInfo;
import com.zc.angelica.service.RoleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/roleInfo")
public class RoleInfoController {

    @Autowired
    private RoleInfoService roleInfoService;

    @PostMapping("/addRole")
    public ResponseData addRole(@RequestBody RoleInfo roleInfo) {
        return roleInfoService.addRole(roleInfo);
    }

    @GetMapping("/slelectRole")
    public ResponseData slelectRole(Integer pageNo, Integer pageSize) {
        return roleInfoService.select(pageNo,pageSize);
    }

    @GetMapping("/modifyState")
    public ResponseData modifyState(Long id, Integer type) {
        return roleInfoService.modifyState(id,type);
    }

    @GetMapping("/deleteRole")
    public ResponseData deleteRole(Long id) {
        return roleInfoService.deleteRole(id);
    }


}
